﻿using System;
using UnityEngine;
using UnityStandardAssets.ImageEffects;

public class BlurCameraIfEnable : MonoBehaviour
{
    private void OnDisable()
    {
        Camera main = Camera.main;
        Blur blur = (main == null) ? null : main.GetComponent<Blur>();
        if (blur != null)
        {
            blur.enabled = false;
        }
    }

    private void OnEnable()
    {
        Camera main = Camera.main;
        Blur blur = (main == null) ? null : main.GetComponent<Blur>();
        if (blur != null)
        {
            blur.enabled = true;
        }
    }
}

